package cn.tedu.boot71.mapper;

import cn.tedu.boot71.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.sql.ResultSet;

@Mapper
public interface UserMapper {
    //如果数据库只返回一个数据,用User接收 如果有多个对象信息得用list集合接收
    @Select("select * from user where username=#{username}")
    User selectByUsername(String username);

    @Insert("insert into user values(null,#{username},#{password},#{nick})")
    void insert(User user);


}
